<template>
  <div v-loading="loading"
      element-loading-text="拼命加载中"
      element-loading-spinner="el-icon-loading"
      element-loading-background="rgba(0, 0, 0, 0.8)">
  </div>
</template>
<script>
import { Qqcallback } from "@/api/login";
export default {
  name: "qqLogin",
  data() {
    return {
      AuthCallback:{
        code:"",
        auth_code:"",
        state:"",
        authorization_code:"",
        oauth_token:"",
        oauth_verifier:""
      },
      loading:true,
    };
  },
  created() {
    this.open()
  },
  methods: {
    open(){
      var url = window.document.location.href.toString();//获得当前url地址并转换成字符串
      var u = url.split("?");//以？来分割字符串，将？前后的值存到一个数组中 
      if(typeof(u[1]) == "string"){//获得？后面具体的请求参数值
        u = u[1].split("&");
        var get = {};
        for(var i in u){
          var j = u[i].split("=");
          get[j[0]] = j[1];
        }
        this.AuthCallback=get
      }
      Qqcallback(this.AuthCallback).then()
        // this.$alert('加载失败，请重新登陆', '提示', {
        //     confirmButtonText: '确定',
        //     callback: action => {
        //       this.$message({
        //         type: 'info',
        //         message: `action: ${ action }`
        //       });
        //       this.$router.push("/login")
        //     }
        //   });
      // })
    }
  }
};
</script>